#include <cstdio>
#include <cmath>

bool isPrime(int n) {
    for (int i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return false;
    }
    return true;
}

int main() {
    const int MAX = 10000;
    int M, N;
    int count = 0;
    int x = 0;

    scanf("%d%d", &M, &N);
    for (int i = 2; i <= MAX; i++) {
        if (isPrime(i)) count++;
        if (count >= M && count <= N) {
            if (isPrime(i)) {
                printf("%d", i);
                x++;
                if (count == N && x != 0) {
                    break;
                }
                if (x % 10 == 0 && x != 0) {
                    printf("\n");
                } else if (x % 10 != 0 && x != 0) {
                    printf(" ");
                }
            }
        }
    }

    return 0;
}